﻿<%@ Page Language="C#" MasterPageFile="~/pages/master/WebForm.Master" AutoEventWireup="true"
    CodeBehind="FunctionEdit.aspx.cs" Inherits="BF.Web.pages.BaseSystem.FunctionManagement.FunctionEdit" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="../../../css/icon.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" language="javascript">
        //关闭
        function DoClose() {
            winer.close();
            return false;
        }
    </script>
    <script type="text/javascript" language="javascript">
        function validate() {
            var result = $("#aspnetForm").validate({
                rules: {
                    ctl00$ContentPlaceHolder1$sName: {//名称
                        required: true
                    }
                },
                messages: {

                },
                errorClass: "errorClass"
            });
            return result.form();
        }


        $(function () {
            var img = document.getElementById('image1');
            var tmp = document.getElementById('ctl00_ContentPlaceHolder1_dropIconCls');
            img.className = tmp.value;

            $("#<%=btnAdd.ClientID %>").click(function () {
                var nodeParam = winer.parentDom.nodeParam;
                window.location.href = "FunctionEdit.aspx?ParentID="
                + nodeParam.sKey + "&ParentType="
                + nodeParam.iType + "&ParentLevel="
                + nodeParam.iLevel;
                winer.win.setTitle('新增系统功能模块');
                return false;
            });

            if ($("#<%=iType.ClientID  %>").val() == "1") {
                $("#trPathOrControlID").hide();
            }
            else if ($("#<%=iType.ClientID  %>").val() == "2") {
                $("#trPathOrControlID").show();
                $("#divPathOrControlID").text("页面路径：");
            }
            else if ($("#<%=iType.ClientID  %>").val() == "3") {
                $("#trPathOrControlID").show();
                $("#divPathOrControlID").text("控件ID：");
            }

            $("#<%=iType.ClientID %>").change(function () {
                if ($("#<%=iType.ClientID  %>").val() == "1") {
                    $("#trPathOrControlID").hide();
                }
                else if ($("#<%=iType.ClientID  %>").val() == "2") {
                    $("#trPathOrControlID").show();
                    $("#divPathOrControlID").text("页面路径：");
                }
                else if ($("#<%=iType.ClientID  %>").val() == "3") {
                    $("#trPathOrControlID").show();
                    $("#divPathOrControlID").text("控件ID：");
                }
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="content01">
        <tbody>
            <tr style="height: 18px;">
                <td colspan="4">
                </td>
            </tr>
            <tr>
                <td align="right" style="width: 20%">
                    名称： </td>
                <td style="width: 30%">
                    <tll:DataTextBox ID="sName" runat="server" FeildName="sName" TableName="sys_Function"></tll:DataTextBox>
                </td>
                <td align="right" style="width: 20%">
                    类型： </td>
                <td style="width: 30%">
                    <asp:DropDownList ID="iType" runat="server">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td align="right">
                    启用状态： </td>
                <td>
                    <asp:CheckBox ID="iIsCanUse" runat="server" Checked="true" />(*打勾代表"启用") </td>
                <td align="right">
                    目录级别： </td>
                <td>
                    <tll:DataLable ID="iLevel" runat="server" FeildName="iLevel" TableName="sys_Function"></tll:DataLable>&nbsp;
                </td>
            </tr>
            <tr>
                <td align="right">
                    是否显示： </td>
                <td>
                    <asp:CheckBox ID="bIsShow" runat="server" Checked="true" />(*打勾代表"显示") </td>
                <td align="right" style="width: 20%">
                    图标： </td>
                <td style="width: 30%">
                    <script type="text/javascript" language="javascript">
                        function DropOnChange() {
                            var img = document.getElementById('image1');
                            var tmp = arguments[0];
                            img.className = tmp.value;
                            return false;
                        }
                    </script>
                    <asp:DropDownList ID="dropIconCls" runat="server" onchange="DropOnChange(this)" >
                        <asp:ListItem Value="">--请选择--</asp:ListItem>
                        <asp:ListItem Value="icon-org">org</asp:ListItem>
                        <asp:ListItem Value="icon-folder">folder</asp:ListItem>
                        <asp:ListItem Value="icon-folder_go">folder_go</asp:ListItem>
                        <asp:ListItem Value="icon-file">file</asp:ListItem>
                        <asp:ListItem Value="icon-button">button</asp:ListItem>
                        <asp:ListItem Value="icon-cog">cog</asp:ListItem>
                        <asp:ListItem Value="icon-user">user</asp:ListItem>
                        <asp:ListItem Value="icon-user_go">user_go</asp:ListItem>
                        <asp:ListItem Value="icon-status_online">status_online</asp:ListItem>
                        <asp:ListItem Value="icon-report">report</asp:ListItem>
                        <asp:ListItem Value="icon-cog_edit">cog_edit</asp:ListItem>
                        <asp:ListItem Value="icon-group">group</asp:ListItem>
                        <asp:ListItem Value="icon-application_form">application_form</asp:ListItem>
                        <asp:ListItem Value="icon-cog_go">cog_go</asp:ListItem>
                        <asp:ListItem Value="icon-page_white_office">page_white_office</asp:ListItem>
                        <asp:ListItem Value="icon-computer">computer</asp:ListItem>
                        <asp:ListItem Value="icon-computer_go">computer_go</asp:ListItem>
                        <asp:ListItem Value="icon-report_user">report_user</asp:ListItem>
                        <asp:ListItem Value="icon-magnifier">magnifier</asp:ListItem>
                        <asp:ListItem Value="icon-stat">stat</asp:ListItem>
                        <asp:ListItem Value="icon-monitor_lightning">monitor_lightning</asp:ListItem>
                        <asp:ListItem Value="icon-world">world</asp:ListItem>
                        <asp:ListItem Value="icon-world_go">world_go</asp:ListItem>
                        <asp:ListItem Value="icon-world_link">world_link</asp:ListItem>
                        <asp:ListItem Value="icon-chart_curve">chart_curve</asp:ListItem>
                        <asp:ListItem Value="icon-chart_curve_go">chart_curve_go</asp:ListItem>
                        <asp:ListItem Value="icon-application_side_list">application_side_list</asp:ListItem>
                        <asp:ListItem Value="icon-application_side_list_go">application_side_list_go</asp:ListItem>
                        <asp:ListItem Value="icon-table">table</asp:ListItem>
                        <asp:ListItem Value="icon-table_go">table_go</asp:ListItem>
                        <asp:ListItem Value="icon-calculator">calculator</asp:ListItem>
                        <asp:ListItem Value="icon-medal_gold_2">medal_gold_2</asp:ListItem>
                        <asp:ListItem Value="icon-coins">coins</asp:ListItem>
                        <asp:ListItem Value="icon-coins_go">coins_go</asp:ListItem>
                        <asp:ListItem Value="icon-coins_delete">coins_delete</asp:ListItem>
                        <asp:ListItem Value="icon-page_word_go">page_word_go</asp:ListItem>
                        <asp:ListItem Value="icon-disease_kind">disease_kind</asp:ListItem>
                        <asp:ListItem Value="icon-book_open">book_open</asp:ListItem>
                        <asp:ListItem Value="icon-database_gear">database_gear</asp:ListItem>
                    </asp:DropDownList>
                    <img src="http://extjs.com/s.gif" id="image1" style="width: 22px; height: 18px; background-repeat: no-repeat;
                        background-position: center 50%; vertical-align: middle !important" class="">
                </td>
            </tr>
            <tr id='trPathOrControlID'>
                <td align="right">
                    <div id='divPathOrControlID'>
                    </div>
                </td>
                <td colspan="3">
                    <tll:DataTextBox ID="sPath" runat="server" FeildName="sPath" Width="480px" TableName="sys_Function"></tll:DataTextBox>
                </td>
            </tr>
            <tr>
                <td align="right">
                    备注： </td>
                <td colspan="3">
                    <tll:DataTextBox ID="sNote" runat="server" FeildName="sNote" Width="480px" Height="80px"
                        TextMode="MultiLine" Columns="3" TableName="sys_Function"></tll:DataTextBox>
                </td>
            </tr>
        </tbody>
    </table>
    <table width="100%" height="36" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
            <td align="center">
                <asp:Button ID="btnAdd" runat="server" TabIndex="0" Text="新增" class="btn04" />&nbsp;
                <asp:Button ID="btnSave" runat="server" TabIndex="0" Text="保存" class="btn04" OnClick="lbtnSave_Click"
                    OnClientClick="return validate();" />&nbsp;
                <asp:Button ID="btnClose" runat="server" OnClientClick="return DoClose() ;" TabIndex="0"
                    Text="关闭" class="btn04" />
                <asp:HiddenField ID="hiddenParentID" runat="server" />
                <asp:HiddenField ID="hiddenParentType" runat="server" />
            </td>
        </tr>
    </table>
    <asp:UpdatePanel ID="Updatepanel1" runat="server">
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnAdd" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="btnSave" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
